home *** CD-ROM | disk | FTP | other *** search
- Path: comma.rhein.de!serpens!not-for-mail
- From: mlelstv@serpens.rhein.de (Michael van Elst)
- Newsgroups: comp.sys.amiga.misc
- Subject: Re: OS features
- Date: 23 Jan 1996 19:07:08 +0100
- Organization: dis-
- Message-ID: <4e384c$13j@serpens.rhein.de>
- References: <DLAA61.2us@inter.NL.net> <4dh2dm$jui@serpens.rhein.de> <1292.6592T166T2158@algonet.se> <4do01q$fmc@serpens.rhein.de> <19960120.7B57BE0.122A3@asd01-04.dial.xs4all.nl> <4dtg0e$1j7@serpens.rhein.de> <19960123.7B89070.14DD@asd07-10.dial.xs4all.nl>
- NNTP-Posting-Host: serpens.rhein.de
-
- jtv@xs4all.nl (Jeroen T. Vermeulen) writes:
- >>
- >> Actually the problem is that the flag MEMF_PUBLIC was never used for
- >> anything and wasn't thought out well.
-
- >AFAIK it is commonly used (and used properly) by applications, and the
- >distinction is relevant for VMM.
-
- It is used. Sometimes properly, sometimes not. Sometimes it is used
- without reason. This comes from the fact that it has two meanings
- (locked memory and shared memory) and it was never checked by the OS.
-
- >What is probably meant is that deadlocks must be prevented, where memory is
- >swapped out that needs to be present in real mem for the swap mechanism as a
- >whole to work. Of course the task list etc. must also be kept consistent during
- >Forbid().
-
- And more. There is data used within interrupts. It is rather impossible
- to page in data for interrupt code.
-
- >It would have to lock, of course. With `single-threaded' I mean here that only
- >one instance of the code could be active at any time (as if it were a task), but
- >no actual context switch is made (as if it were a library).
-
- As I said this is not possible because the driver may consist of several
- tasks that _do_ require context switches. It also is a waste of time
- to forbid other tasks to run after one task page-faulted.
-
- >You mean separate flag bits for "swappable" and "sharable"? AFAICS the only
- >pools that had to be locked in memory would be:
-
- You wouldn't use "bits" for AllocMem but you would declare memory
- regions with different properties. There would be new functions to
- create memory pools in such regions. AllocMem then would be an
- alias to allocate memory from one or more default pools that are
- created with the task.
-
- > - Private memory allocated by the VM subsystem
-
- Most of the VM system itself can be in virtual memory. It even
- makes sense as the MMU tables can be pretty big.
-
- > - Global shared public mem (eg. public process list)
-
- There is no reason to lock shared memory.
-
- > - Memory shared between any task and the VM subsystem + VM device driver
-
- This has to be locked during the transfer only.
-
- >Am I missing another useful application?
-
- You haven't named one. The only real memory is needed for a) the
- DMA buffers and b) for data used in interrupt code.
-
- Since old programs do not declare interrupt code or DMA buffers
- this needs some special handling. Most "normal" programs do not
- use interrupts or DMA buffers themselves though. That's why it is
- possible to tag these programs as VM proof.
-
- >Libraries aren't a problem in themselves, because they never leave the caller's
- >context unless they're programmed to.
-
- That _is_ the problem as they create data that is shared by several
- tasks. This data is private to the library though, which means you
- need a protected space in the library that can only accessed from within
- the library code independent of which task is actually executing it.
-
- >Of course, but it must be supported for existing software. And with the scheme
- >outlined above I think it can be, even in such multiprocessor configurations.
-
- As I said, Forbid() is not just a semaphore to shared memory.
-
-
- --
- Michael van Elst
-
- Internet: mlelstv@serpens.rhein.de
- "A potential Snark may lurk in every tree."
-